package com.zl.smartmall.library.po;

import org.json.JSONException;
import org.json.JSONObject;

/**
 * 快递信息
 * @author 陈希然
 *
 */
public class ExpressInfo {

	private String expressSn;// 快递单号
	private String expressHabit;// 快速时间喜好
	private String expressCompany;// 快递承运商
	private double deliveryCost;// 运费
	private String shipAddress;// 发货商
	private double shipTime;// 发货时间

	public String getExpressSn() {
		return expressSn;
	}

	public void setExpressSn(String expressSn) {
		this.expressSn = expressSn;
	}

	public String getExpressHabit() {
		return expressHabit;
	}

	public void setExpressHabit(String expressHabit) {
		this.expressHabit = expressHabit;
	}

	public String getExpressCompany() {
		return expressCompany;
	}

	public void setExpressCompany(String expressCompany) {
		this.expressCompany = expressCompany;
	}

	public double getDeliveryCost() {
		return deliveryCost;
	}

	public void setDeliveryCost(double deliveryCost) {
		this.deliveryCost = deliveryCost;
	}

	public String getShipAddress() {
		return shipAddress;
	}

	public void setShipAddress(String shipAddress) {
		this.shipAddress = shipAddress;
	}

	public double getShipTime() {
		return shipTime;
	}

	public void setShipTime(double shipTime) {
		this.shipTime = shipTime;
	}

	public static ExpressInfo parse(JSONObject jsonObjcet) throws JSONException {
		if(jsonObjcet != null && jsonObjcet.length() > 0) {
			ExpressInfo express = new ExpressInfo();
			express.deliveryCost = jsonObjcet.getDouble("express_fee");
			express.expressCompany = jsonObjcet.getString("express_company");
			express.expressHabit = jsonObjcet.getString("express_habit");
			express.expressSn = jsonObjcet.getString("express_sn");
			express.shipAddress = jsonObjcet.getString("goods_company");
			express.shipTime = jsonObjcet.getDouble("deliveryTime");
			return express;
			
		}else {
			return null;
		}
	}
}
